Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompute TTL values on each get #63

Merged
merged 1 commit into from
Oct 27, 2023
Merged

Conversation

davidsloan
Copy link
Contributor

@davidsloan davidsloan commented Oct 26, 2023

This is a rebase of the Azure segments of #34 by @kppullin-nt against the latest codebase.

The original description follows.


TTL values must be recomputed on each get action instead of being fixed to a constant value for the lifetime of the cached object.

Prior to this change, the constant TTL value X would cause kafka-connect to continually reschedule connector restarts X milliseconds in the future, effectively ensuring that the connector never actually restarts.

With this change, the reschedule actions have a timestamp that shrinks until the TTL is reached.

Before (note contant restart time of ~30 mins):

2021-12-03 20:19:65,634 INFO   ||  Scheduling a restart of connector debezium_infra in 1799900 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
2021-12-03 20:18:25,143 INFO   ||  Scheduling a restart of connector debezium_infra in 1799900 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]

After (note restart time decreases ~40 seconds and the log messages are ~40 seconds apart):

2021-12-03 21:09:24,228 INFO   ||  Scheduling a restart of connector debezium_infra in 2063263 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
2021-12-03 21:08:45,858 INFO   ||  Scheduling a restart of connector debezium_infra in 2101945 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]

Fix build issues with Azure tests

Set the TTL to None if the duration is 0

TTL values must be recomputed on each `get` action instead
of being fixed to a constant value for the lifetime of the cached object.

Prior to this change, the constant TTL value `X` would cause kafka-connect
to continually reschedule connector restarts `X` milliseconds in the future,
effectively ensuring that the connector never actually restarts.

With this change, the reschedule actions have a timestamp that shrinks until
the TTL is reached.

Before (note contant restart time of ~30 mins):
```
2021-12-03 20:19:65,634 INFO   ||  Scheduling a restart of connector debezium_infra in 1799900 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
2021-12-03 20:18:25,143 INFO   ||  Scheduling a restart of connector debezium_infra in 1799900 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
```

After (note restart time decreases ~40 seconds and the log messages are ~40 seconds apart):
```
2021-12-03 21:09:24,228 INFO   ||  Scheduling a restart of connector debezium_infra in 2063263 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
2021-12-03 21:08:45,858 INFO   ||  Scheduling a restart of connector debezium_infra in 2101945 ms   [org.apache.kafka.connect.runtime.WorkerConfigTransformer]
```

Fix build issues with Azure tests

Set the TTL to `None` if the duration is `0`
@andrewstevenson andrewstevenson merged commit eac6be7 into master Oct 27, 2023
2 checks passed
@andrewstevenson andrewstevenson deleted the contrib/pr-34-rebase branch October 27, 2023 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants